#include <stdio.h>
int main()
{
    char n[20] = {0};
    int arr[10] = {0};
    int i = 0;
    printf("Enter a number:");
    scanf("%s", n);
    if(n[0] == 48)
        arr[0] = 1;
    else    
    {
        for(i = 0;i < 20;i++)
        {
            switch(n[i]-48)
            {
                case 0:arr[0]++;break;
                case 1:arr[1]++;break;
                case 2:arr[2]++;break;
                case 3:arr[3]++;break;
                case 4:arr[4]++;break;
                case 5:arr[5]++;break;
                case 6:arr[6]++;break;
                case 7:arr[7]++;break;
                case 8:arr[8]++;break;
                case 9:arr[9]++;break;
                default:goto end;
            }
        }
        end:
    }
    printf("Digit:	    0 1 2 3 4 5 6 7 8 9\n");
    printf("Occurrences:");
    for(i = 0;i < 10;i++)
    {
        printf("%d ", arr[i]);
    }
    return 0;
}